In [6]:
# Import utilities
import lsst.afw.image as afwImage
import numpy
from matplotlib import pylab as plt
%matplotlib inline
# Download images from Simon:
!curl -k -O http://www.astro.washington.edu/users/krughoff/data/twinkles_firstlight_interesting.fits
!curl -k -O http://www.astro.washington.edu/users/krughoff/data/twinkles_firstlight_boring.fits
# Read in two images from PhoSim run, one with lenses, one without:
interesting = afwImage.ImageF('twinkles_firstlight_interesting.fits')
boring = afwImage.ImageF('twinkles_firstlight_boring.fits')
In [13]:
# Adjust settings for image display:
settings = dict(cmap='cubehelix', interpolation='nearest', origin='lower', vmin=-5, vmax=50)
interestingArr = interesting.getArray()
boringArr = boring.getArray()
# Subtract median first so the interesting and difference image can be plotted
# with the same scale.
interestingArr -= numpy.median(interestingArr)
boringArr -= numpy.median(boringArr)
# Difference the images:
diff = interesting.getArray() - boring.getArray()
# Plot!
fig = plt.figure(figsize=(24.,18.))
ax1 = fig.add_subplot(2,1,1)
cax1 = ax1.imshow(diff, **settings)
cbar1 = fig.colorbar(cax1)
_ = ax1.set_title("Difference from Boring Data Image")
ax2 = fig.add_subplot(2,2,1)
cax2 = ax2.imshow(interesting.getArray(), **settings)
cbar2 = fig.colorbar(cax2)
_ = ax2.set_title("Interesting Data Image")
In [ ]: